package ${cfg.package_name}.bean;


import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import com.rt.easyjava.common.base.BaseV3Bean;
import java.util.Date;

/**
 * ${table.comment!}
 * @author ${author}
 * @since ${date}
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
//@Builder
//@AllArgsConstructor
//@NoArgsConstructor
@TableName(value = "${cfg.tableName}")
public class ${entity} extends BaseV3Bean<${entity}>{

<#assign ignColumnList=["id","deleteFlag","createTime","updateTime","creator","creatorId","updator","updatorId","companyId","version"]/>

<#list cfg.columnList as column>
 <#if (column.tableAliasName == "" || column.tableAliasName == "t1") && !ignColumnList?seq_contains(column.propertyName) >
  <#if column.isPrimaryKey=="true">
   <#if cfg.idType?? && cfg.idType=='uuid'>
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
   <#elseif cfg.idType?? && cfg.idType=='none'>
    @TableId(value = "id", type = IdType.NONE)
   <#else >
    @TableId(value = "id", type = IdType.AUTO)
   </#if>
  </#if>
    private ${column.columnType4JavaEncap} ${column.propertyName}; // ${column.comment!}
 </#if>
</#list>

<#if cfg.hasM2O>
 // Many to One
 <#list cfg.tableNameM2OList as tableNameMap>
    @TableField(exist = false)
    private ${tableNameMap.className}Biz ${tableNameMap.classInstance};
 </#list>
</#if>

<#list cfg.o2mList as o2m>
<#if o2m.hasO2M>
    // One to Many
    @TableField(exist = false)
    private List<${o2m.classNameFirstWordUpperO2M}Biz> ${o2m.classNameFirstWordLowerO2M}List;
</#if>
</#list>

<#if cfg.isTreeTable == true>
    // 当树表时，用这个存储子树
    @TableField(exist = false)
    private List<${entity}> ${table.entityPath}List;
</#if>

}
